<template>
  <el-dialog :visible.sync="value" :before-close="() => $emit('input', false)">
    <template slot="title">
      异常充值处理
    </template>
    <el-tip>该异常充值已经得到确认进行相关处理？</el-tip>
    <el-form :model="form" ref="refForm" :rules="rules">
      <div>备注</div>
      <el-form-item>
        <el-input type="textarea" v-model="form.comment" @keyup.enter.native="doSave({action: 'saveForm', form: 'refForm'})"></el-input>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="$emit('input', false)" :loading="loading">取 消</el-button>
      <el-button type="primary" @click="doSave({action: 'saveForm', form: 'refForm'})" :loading="loading">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>

// services
import { handleRechargeException } from '@/services/api/recharge';

// mixins
import { form } from '@/build';

export default {
  name: 'exception-handle-dialog',
  props: ['value', 'id'],
  mixins: [form],
  data() {
    return {
      form: {
        id: this.id,
        comment: undefined,
      },
      applyData: {},
      rules: {

      },
    };
  },
  methods: {
  },
  mounted() {
    this.bindSave(handleRechargeException, 'saveForm', 'form', {
      beforeSend: data => ({ ...data, id: this.id }),
      afterSuccess: () => {
        this.$emit('input', false);
      },
    });

    this.getAll();
  },
};
</script>

<style scoped>
</style>
